home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Tool Chest / QuickDraw / Bitblitz 1.0 / Source / BitBlitz.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-21  |  3.6 KB  |  136 lines  |  [TEXT/MPS ]

  1. /*--------------------------------------------------------------------------------------
  2. //
  3. //    File:          BitBlitz.h
  4. //
  5. //    Contents:    Type definitions, global constants and variables, and routine declarations
  6. //                used externally to the BitBlitz.c segment.
  7. //
  8. //
  9. //    By Georgiann ("George") Delaney
  10. //    © 1989 - 1990, Apple Computer, Inc.
  11. //
  12. //--------------------------------------------------------------------------------------*/
  13.  
  14.  
  15.  
  16. /*--------------------------------------------------------------------------------------*/
  17. /*  Constants  */
  18.  
  19.  
  20. #define  kClpRgn        0                /*  Region ID constants  */
  21. #define  kVisRgn        1
  22. #define  kMskRgn        2
  23.  
  24. #define  kSrcWindow        0                /*  Window ID constants  */
  25. #define  kMskWindow        1
  26. #define  kDstWindow        2
  27. #define  kBitWindow        3
  28.     
  29. #define     kCopyMask        0                /*  Trap selection constants  */
  30. #define     kCopyDeepMask    1
  31. #define     kCopyBits        2
  32.  
  33.  
  34. /*--------------------------------------------------------------------------------------*/
  35. /*  Type definitions  */
  36.  
  37.  
  38. typedef struct {                        /*  Struct which holds color information for    */
  39.     short        menuIndex;                /*  setting the FG, BK, OP, and Hilite colors.  */
  40.     RGBColor    rgb;
  41. }  ColorAttributes;
  42.  
  43.  
  44. typedef struct {                    
  45.     short        type;            
  46.     RgnHandle    rgn;
  47. }  RgnAttributes;
  48.  
  49.  
  50. typedef struct  {                        /*  Definition of the window attributes record  */
  51.     WindowPtr    window;                    /*  describing the contents/status of each of   */
  52.     short        bufferType;                /*  the 4 CopyMask windows                        */
  53.     short         bufferDepth;
  54.     union  {
  55.         GWorldPtr    gworld;
  56.         CGrafPtr    pixmap;
  57.         GrafPtr        bitmap;
  58.         } buffer;
  59.     short         contentType;
  60.     union  {
  61.         short         saturation;
  62.         RGBColor     RGB;
  63.         PicHandle    pictInfo;
  64.         } content;
  65. }  WindowAttributes;
  66.  
  67.  
  68.  
  69.  
  70. /*--------------------------------------------------------------------------------------*/
  71. /*  Global Variables  */
  72.  
  73. RgnAttributes        gRList[3];
  74.  
  75. WindowAttributes    gWList[4];                /*  Window list containing the 4 CopyMask Windows
  76.                                                   attribute records.                              */
  77.  
  78. short        gCopyMode    = srcCopy;            /*  The current copy mode that will be applied 
  79.                                                 in the CopyMask() call.                          */            
  80.  
  81. short        gTrapSelect = kCopyMask;        /*  This global designates which of the two traps
  82.                                                 that the user wishes to test                    */
  83.  
  84.  
  85. Boolean        gColorAvail;        /* Global variable designating that color QuickDraw is around     */
  86. Boolean        gGWorldsAvail;        /* Global variable designating that GWorlds are implemented/     */
  87.  
  88. Boolean     gUseScreenBits = false;
  89. Boolean     gDither        = false;
  90.  
  91. ColorAttributes    gFGColor,
  92.                 gBKColor,
  93.                 gOPColor,
  94.                 gHiliteColor;
  95.     
  96. RgnHandle    gHoldVisRgn    = nil;
  97. RgnHandle    gHoldClpRgn    = nil;
  98.  
  99.  
  100.  
  101. /*--------------------------------------------------------------------------------------*/
  102. /*  Externally visible routines  */
  103.  
  104. Boolean myTrapAvailable            (theNumber,theType);
  105.  
  106. void    InitTestGlobals            (void);
  107. void     InitColorSettings        (void);
  108.  
  109. void      InitRgnSettings            (void);
  110. void     UpdateRgnSettings        (void);
  111. void    DisposeRgnSettings        (void);
  112.  
  113. void      InitTestWindowAttributes(void);
  114. Boolean    CreateTestWindows        (void);
  115. void      DisposeTestWindows        (void);
  116.  
  117. Boolean ResizeTestWindow        (Point *newDimen, short windowCode);
  118. Boolean ChangeWindowAttributes  (short windowCode);
  119.  
  120. void      SelectFGColor            (short theItem);
  121. void      SelectBKColor            (short theItem);
  122. void      SelectOPColor            (short theItem);
  123. void      SelectHiliteColor        (short theItem);
  124.  
  125. void      SelectRgn                (short rgnCode, short rgnType);
  126. Boolean SelectTrap                (void);
  127.  
  128. void      DrawBuffer                (short windowCode);
  129. void      DrawWindow                (short windowCode);
  130.  
  131. short      CopyMode2ModeMenuItem    (short theMode);
  132. short      ModeMenuItem2CopyMode    (short theItem);
  133.  
  134. void      NeedSystem7Dlog            (void);
  135. void      AboutBitBlitz            (void);
  136.